package com.xiangxiao.rpan.gateway.enums;

/**
 * @auther xiangxiao
 * @email 573768011@qq.com
 * @data 2023/2/13 17:32
 */
public enum ResponseCode {

  /**
   *14        权限14开头
   *140000	通用操作成功
   *140001	通用操作失败
   *140002	用户操作权限不足
   */

  SUCCESS(10000000),
  FAILED(14000001),
  FORBIDDEN(14000002),
  ACCOUNT_NOT_EXIST(14000009),
  ACCOUNT_DISABLED(14000010);

  private Integer respCode;

  ResponseCode(Integer respCode) {
    this.respCode = respCode;
  }

  public Integer getRespCode() {
    return respCode;
  }

  public String getCodeMsg(){
    String msg = "";
    switch (this) {
      case SUCCESS:
        msg = "操作成功";
        break;
      case FAILED:
        msg = "操作失败";
        break;
      case FORBIDDEN:
        msg = "操作权限不足";
        break;
      case ACCOUNT_DISABLED:
        msg = "您的账号已失效，请联系管理员！";
        break;
      case ACCOUNT_NOT_EXIST:
        msg = "账号不存在，请联系管理员！";
      default:
        break;
    }
    return msg;
  }
}
